import { createApp } from "vue";
import App from "./App.vue";
// 谷歌浏览器告警
import 'default-passive-events'
import '@/utils/browserPatch'
import 'virtual:uno.css'
// element css
import "element-plus/dist/index.css";
// element dark css
import "element-plus/theme-chalk/dark/css-vars.css";
// 全局样式
import "@/assets/styles/globals.scss";

import pinia from "./store";
import router from "./router";
import ElementPlus from "element-plus";
import { ElMessage } from "element-plus";
import * as ElIcons from "@element-plus/icons-vue";
// 自定义组件
import mcProUi from "mc-pro-ui";
// 自定义指令
import directive from "@/utils/directive";

const app = createApp(App);
app.use(ElementPlus);
app.use(mcProUi); //全局注册
app.use(pinia);
app.use(router);
directive(app);

for (const iconName in ElIcons) {
  app.component(iconName, ElIcons[iconName as keyof typeof ElIcons]);
}
app.config.globalProperties.$message = ElMessage;
app.mount("#app");
